package priv.pront.code.lanqiao.competition.course.date0327;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class 矩阵翻硬币 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String n = scanner.next();
        String m = scanner.next();
        System.out.println(sqrt(n).multiply(sqrt(m)));
    }

    private static BigInteger sqrt(String s) {
        int length = s.length();
        int len = 0;
        len = length % 2 == 0 ? length / 2 : length / 2 + 1;
        char[] sArr = new char[len];
        Arrays.fill(sArr, '0');
        for (int pos = 0; pos < len; pos++) {
            for (char c = '0'; c <= '9'; c++) {
                sArr[pos] = c;
                BigInteger pow = new BigInteger(String.valueOf(sArr)).pow(2);
                if (pow.compareTo(new BigInteger(s)) == 1) {
                    sArr[pos] -= 1;
                    break;
                }
            }
        }
        return new BigInteger(String.valueOf(sArr));
    }
}
